function popSort(arr) {
  let i = 0;
  let length = arr.length;
  for (i = 0; i < length - 1; i++) {
    for (let j = 0; j < length - i - 1; j++) {
      if (arr[j] > arr[j + 1]) {
        let temp = arr[j];
        arr[j] = arr[j + 1];
        arr[j + 1] = temp;
      }
    }
  }
}
function swap(i, j) {
  let temp = i;
  i = j;
  j = temp;
}
let arr = [2, 3, 4, 1, 2, 9];
popSort(arr);
console.log(arr);
